import axios from "@/utils/require"


//获取购物车详情数据
export function getCartInfo(userid:string){
    return axios({
        url: "/cart/list",
        method:"post" ,
        data:{userid}
        
    })
}
// 获取推荐商品
export function recommendlist(params:{count:number,limitNum:number}){
    return axios({
        url: "/pro/recommendlist",
        method:"get" ,
        params
    })
}
// 获取推荐商品
export function removeCart(cartid:string){
    return axios({
        url: "/cart/remove",
        method:"post" ,
        data:{
            cartid
        }
    })
}
// 商品数量++
export function updatenumCart(data:{cartid:string,num:number}){
    return axios({
        url: "/cart/updatenum",
        method:"post" ,
        data
    })
}
// 当前商品选中状态
export function selectoneCart(data:{cartid:string,flag:boolean}){
    return axios({
        url: "/cart/selectone",
        method:"post" ,
        data
    })
}
//改变购物车的全选选中状态
export function checkCartAll(data:{userid:string,type:boolean}) {
    return axios({
        url: "cart/selectall",
        method: "post",
        data
    })
}
// 添加订单



export function addOrderCart(userid:string) {
    return axios({
        url: "/order/addOrder",
        method: "post",
        data:{
            userid
        }
    })
}




